package edu.uoc.tdp.pac4.common.beans;

import java.rmi.RemoteException;
import java.util.Iterator;
import java.util.List;

import javax.swing.JComboBox;

import edu.uoc.tdp.pac4.common.interfaces.S2Interface;

public class S2ComboMarques extends JComboBox<S2_2CarTrademark>{
	
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -7613995721578629319L;

	public S2ComboMarques (S2Interface s2Interface) {
		
		super ();
		
		try {
			
			S2_2CarTrademark c = null;
			
			this.addItem(c);
			
			List<S2_2CarTrademark> llista = s2Interface.getMarcaLst();
			
			Iterator<S2_2CarTrademark> it = llista.iterator();
			
			while (it.hasNext()){
				
				c = (S2_2CarTrademark) it.next();
				
				this.addItem(c);
				
				 
				
			}
			
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		
		
		
	}
	
	

}
